import { _decorator, Button, Component, Label, Node } from 'cc';
import { BasePanel } from '../Base/BasePanel';
import { SoundMgr } from '../Managers/SoundMgr';
const { ccclass, property } = _decorator;

@ccclass('AlertUIPanel')
export class AlertUIPanel extends BasePanel {

    //msg
    @property(Label)
    public msg:Label;
    /**
     * 关闭
     */
    @property(Button)
    public closeBtn:Button;

    start() {
        this.bindBtnClick(this.closeBtn, this.OnClickCloseBtn);
    }

    // update(deltaTime: number) {}

    private OnClickCloseBtn():void{
        SoundMgr.Instance.playEffect("btn_click");
        this.Dispose();
    }

    //
    public SetData(my:number):void{
        if(my == 1){
            this.msg.string = "恭喜你获胜啦！";
        }else{
            this.msg.string = "很遗憾，你输啦！";
        }
        
    }
}

